#pragma once

#include "Globals.hpp"
#include "Message.h"
#include "BaseGameEntity.h"
#include "MessageTypes.h"


// To make life eaier
#define Dispatcher MessageDispatcher::Instance()

class MessageDispatcher
{
private:
	/* This simply calls the HandleMessage() function of the receiving entity for the given message */
	void Discharge(BaseGameEntity* pReceiver, const Message& msg);

	MessageDispatcher() {};

	MessageDispatcher(const MessageDispatcher&);
	MessageDispatcher& operator=(const MessageDispatcher&);

public:
	static MessageDispatcher* Instance() {static MessageDispatcher instance; return &instance;}

	void DispatchMessage(int sender,
							int receiver,
							MessageType type,
							void* ExtraInfo);
							
};